package com.example.ytyproject.controller;


import com.alibaba.fastjson.JSONObject;
import com.example.ytyproject.entity.ShopBoardInfo;
import com.example.ytyproject.entity.ShopMember;
import com.example.ytyproject.entity.vo.R;
import com.example.ytyproject.service.ShopBoardInfoService;
import lombok.extern.slf4j.Slf4j;
import org.apache.ibatis.annotations.Param;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 * 商铺餐桌管理信息表 前端控制器
 * </p>
 *
 * @author author
 * @since 2024-07-17
 */
@RestController
@RequestMapping("/geek/shop/boardInfo")
@Slf4j
public class ShopBoardInfoController {

    @Autowired
    private ShopBoardInfoService shopBoardInfoService;

    @PostMapping("/queryAllByShopId")
    public R queryAllByShopId(@Param("shopId") String shopId) {
        log.info("ShopBoardInfoController queryAllByShopId info: {}", shopId);
        return shopBoardInfoService.queryAllByShopId(shopId);
    }

    @PostMapping("/addData")
    public R addData(@RequestBody ShopBoardInfo param) {
        log.info("ShopBoardInfoController addData param: {}", JSONObject.toJSONString(param));
        shopBoardInfoService.addData(param);
        return R.ok();
    }

}
